#ifndef MYTESTMODEL_H
#define MYTESTMODEL_H

#include <QAbstractTableModel>
#include <QVariant>
#include <QAxObject>
#include <QStringList>

class MyTestModel : public QAbstractTableModel
{
    Q_OBJECT
public:
    MyTestModel(QString xls_file);

    void setMyData(int idata);
    QVariant data(const QModelIndex &item, int role) const;
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    int columnCount(const QModelIndex &parent = QModelIndex()) const;
    QVariant headerData (int section, Qt::Orientation orientation, int role) const;

    void openExcel(QString fileName);
    void castVariant2ListListVariant(const QVariant &var);
    QVariant readAll(QAxObject *sheet);
private:
    int iRow;
    int iCol;
    QVariantList varRows;
    QStringList header;
    QStringList headers;
};

#endif // MYTESTMODEL_H
